<?php
class AuditTrail extends DataObject{
	private static $db = array(
		'ObjectClass' => 'Varchar(250)',
		'Version' => 'Int',
		'RowID' => 'Int',
		'IPAddress' => 'Varchar(100)'
	);
	
	private static $has_one = array(
		'Member' => 'Member'
	);
	
	private static $has_many = array(
		'AuditTrailDetails' => 'AuditTrailDetail'
	);
}

class AuditTrailDetail extends DataObject{
	private static $db = array(
		'OldValue' => 'Text',
		'NewValue' => 'Text'
	);
	
	private static $has_one = array(
		'AuditTrail' => 'AuditTrail'
	);
    
    static function EncodeData($data){
        $encode_data = base64_encode(serialize($data));
        return $encode_data;
    }
    
    static function DecodeData($data){
        $decode_data = unserialize(base64_decode($data));
        return $decode_data;
    }
}
?>